using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MoleCart.Core.Common;
using System.Linq.Expressions;
using MoleCart.Core.Domain;

namespace MoleCart.Core.Data {
	public interface IRepository<T> where T : EntityBase {
		object Insert(T entity);
		void Update(T entity);
		void Delete(T entity);

		T GetById(object id);
		T LoadById(object id);
		IList<T> GetAll();
		PaginatedList<T> GetAll(int pageIndex, int pageSize);
		PaginatedList<T> GetAll<Tkey>(int pageIndex, int pageSize, Expression<Func<T, bool>> where = null, Expression<Func<T, Tkey>> order = null, SortType type = SortType.Asc);

	}



}
